package com.hw1102.Test4;

public class Company implements Money {
    @Override
    public void salary(Emp emp) {
        int n = 0;
        if (emp instanceof Manager) {
            System.out.println(emp.getName() + "的薪资:" + emp.getSal() + "  |  银行卡余额:"+(emp.getSal()+((Manager) emp).getBonus())*n);
        }else if (emp instanceof Clerk){
            System.out.println(emp.getName() + "的薪资:" + emp.getSal() + "  |  银行卡余额:"+(emp.getSal()*n));
        }
        n++;
    }
}
